#include <bits/stdc++.h>
using namespace std;
const int N = 5010;

int a[N], b, c[N];
int la, lc;

void div()
{
	long long t = 0;
	for(int i = la - 1;i >= 0;i --)
	{
		t = t * 10 + a[i];
		c[i] = t / b;
		t %= b;
	}
	while(lc > 1 && c[lc - 1] == 0) lc --;
}

int main()
{
	string s; cin >> s;
	cin >> b;
	la = s.size(), lc = la;
	for(int i = 0;i < la;i ++) a[la - 1 - i] = s[i] - '0';
	div();
	for(int i = lc - 1;i >= 0;i --) cout << c[i];
	return 0;
}